<template>
  <div class="myinput">
    <input v-model="value" type="text" placeholder="请输入搜索内容..." />
    <span @click="search(value)">搜索</span>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: "",
    };
  },
  methods: {
    search(value) {
      this.$emit("send:value", value);
    },
  },
};
</script>

<style lang="scss" scoped>
.myinput {
  width: 100%;
  height: 40px;
  border-radius: 6px;
  position: relative;
  input {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    border: 1px solid rgb(54, 158, 243);
    outline: none;
    text-indent: 1em;
  }
  span {
    position: absolute;
    top: 8px;
    right: 20px;
  }
}
</style>